import os

def find_png_jpg_files(directory):
    png_jpg_files = []
    for root, dirs, files in os.walk(directory):
        for file in files:
            if file.lower().endswith(('.png', '.jpg')):
                png_jpg_files.append(os.path.join(root, file))
    return png_jpg_files

def remove_at_symbol(image_filenames):
    cleaned_image_names = []
    for name in image_filenames:
        cleaned_name = name.split('@')[0]
        cleaned_image_names.append(cleaned_name)
    return cleaned_image_names

def main():
    directory = input("请输入要检查的路径: ")  # 输入要检查的路径
    if not os.path.isdir(directory):
        print("错误：指定路径不存在或不是一个目录！")
        return
    
    image_files = find_png_jpg_files(directory)
    image_names = [os.path.basename(image_file) for image_file in image_files]
    cleaned_image_names = remove_at_symbol(image_names)
    
    print("处理后的图片名称：")
    for name in cleaned_image_names:
        print(name)

if __name__ == "__main__":
    main()
